var gulp = require('gulp'),
cache = require('gulp-cached'),
jshint = require('gulp-jshint');

gulp.task('jshint', function () {
    gulp.src('js/**/*.js')
    .pipe(cache('jshint'))
    .pipe(jshint({esnext:true})) // Support for es6
    .pipe(jshint.reporter('default'));
});

gulp.task('watch', function () {
gulp.watch('js/**/*.js', ['jshint']);
});

gulp.task('default', ['jshint', 'watch']);